package com.cbd.pojo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;

/**
 * 用户登录表
 * 
 */
@Entity
@Table(name="user")
@Validated
public class User implements Serializable{
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="userID")
	private int userID;
	/**
	 * 用户登录名
	 * 
	 */
	@Column(name="userName")
	@NotEmpty(message="不能为空")
	@Length(max=20,min=6,message="长度必须为6-20位")
	private String userName;
	/**
	 * 用户登录密码
	 * 
	 */
	@Column(name="userPWD")
	@NotEmpty(message="不能为空")
	@Length(max=20,min=6,message="长度必须为6-20位")
	private String userPWD;
	
	/**
	 * @Fields userRole : 0:表示包租婆，1表示抢租客，2表示企业，3表示管理员
	 */ 
	@Column(name="userRole")
	private int userRole;
	
	public int getUserRole() {
		return userRole;
	}

	public void setUserRole(int userRole) {
		this.userRole = userRole;
	}

	public int getUserID() {
		return userID;
	}

	public void setUserID(int userID) {
		this.userID = userID;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserPWD() {
		return userPWD;
	}

	public void setUserPWD(String userPWD) {
		this.userPWD = userPWD;
	}

}